# Contributor: Sascha Paunovic <azarus@posteo.net>
# Contributor: Nicolas Lorin <androw95220@gmail.com>
# Maintainer: Sascha Paunovic <azarus@posteo.net>
pkgname=veracrypt
_pkgname=VeraCrypt
pkgver=1.25.9
pkgrel=0
pkgdesc="disk encryption with strong security based on TrueCrypt"
url="https://www.veracrypt.fr/"
arch="all !x86 !s390x" # issues on linking
license="Apache-2.0"
depends="device-mapper"
makedepends="fuse-dev wxgtk-dev libsm-dev yasm"
options="!check" # no test suite provided
subpackages="$pkgname-doc"
source="$pkgname-$pkgver.tar.bz2::https://launchpad.net/veracrypt/trunk/$pkgver/+download/${_pkgname}_${pkgver}_Source.tar.bz2
	10-ssize-t.patch
	"
builddir="$srcdir/src"

build() {
	make TC_EXTRA_LFLAGS="-ldl $LDFLAGS" \
		TC_EXTRA_CXXFLAGS="$CXXFLAGS $CPPFLAGS" \
		TC_EXTRA_CFLAGS="$CFLAGS $CPPFLAGS"
}

package() {
	install -Dm 755 Main/$pkgname "$pkgdir"/usr/bin/$pkgname
	install -Dm 644 Resources/Icons/VeraCrypt-256x256.xpm \
		"$pkgdir"/usr/share/pixmaps/veracrypt.xpm
	install -Dm 644 License.txt "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
	mkdir -p "$pkgdir"/usr/share/applications
	cat >> "$pkgdir"/usr/share/applications/veracrypt.desktop <<-EOF
	[Desktop Entry]
	Type=Application
	Exec=veracrypt
	Icon=veracrypt.xpm
	Comment=Disk encryption with strong security based on TrueCrypt
	Terminal=false
	Name=VeraCrypt
	StartupNotify=true
	Categories=System;Administration;
	EOF
}

sha512sums="
9b11c8d8e85770ae05960fef8fc9639731e4f9caf0cc4e50bc8c9c92b45d44c80eaeff483d3ab048fd6a82cc873a6027820e21abde7ddb92b3c368f85b837cf2  veracrypt-1.25.9.tar.bz2
d0f31db39fd98a073e67cb70cc53e8b61a8fc47be12b84395b75607b4ba56c18a47cffc63b60f10421edb59ca464141e9cbc4221080a840fdb73cf2bedfb816d  10-ssize-t.patch
"
